import { addCourseApi, getCourseDetailsApi, getCourseListApi, courseUpdateApi } from '../../../../api/course/course'
import gradeApi from '../../../../api/grade/index'
import { subject, teacher } from '../../../../api/index'
export default {
    state: {
        list: [],
        teacherList: []
    },
    effects: {
        *getCourseList({ payload }, { call, put }) {
            console.log(101001);
            const data = yield call(getCourseListApi)
            console.log(34567, data);
            yield put({ type: 'getCourse', payload: data.records })
        },
        *getTeacherList({ payload }, { call, put }) {
            const data = yield call(teacher.getTeacherList())
            console.log(4545, data);
        }
    },
    reducers: {
        getCourse(state, action) {
            return {
                ...state,
                list: action.payload
            }
        }
    }
}